<!DOCTYPE html>
<html>
<#include "../head.html">
    <body>
    <div class="mc">
        <div class="mc-l">
            <!--左侧导航---{-->
            <div id="navPanelContainer">
                <div class="system-logo cd"></div>
                <!--管理员信息---{-->
                <#include "../adminInfo.html">
                    <!--管理员信息---}-->
                    <div class="nav-wrap">
                        <#include "leftFromYyToCf.html">
                    </div>
            </div>
            <!--左侧导航---}-->
        </div>
        <div class="mc-m">
            <div class="navToggle"></div>
        </div>
        <div class="mc-r">
            <!--顶部导航---{-->
            <#include "../topNav.html">
                <!--顶部导航---}-->

                <!--面包屑导航---{-->

                <#include "banner.html">
                    <!--面包屑导航---}-->

                    <!--工具栏--{-->
                    <div id="toolbar" class="clearfix">
                        <div class="toolbor-module export">
                            <a href="/admin/crm/addFromYyToCf.html" class="input-button">+添加</a>
                        </div>
                        <div class="toolbor-module search">
                            <input type="button" value="搜索"  class="input-button" onclick="sousuo();">
                        </div>
                        <div class="toolbor-module search">
                            <div class="formTit">用户名：</div>
                            <input type="text" name="userName" id="userName" class="search-value">
                        </div>
                        <div class="toolbor-module search">
                            <div class="formTit">姓名 /身份证/手机：</div>
                            <input type="text" name="searchName" id="searchName" class="search-value">
                        </div>
                        <div class="toolbor-module search">
                            <div class="formTit">结束日期：</div>
                            <input id="endDate" type="text" name="endDate" style="float:left" onclick="change_picktime('yyyy-MM-dd')" readonly/>
                        </div>
                        <div class="toolbor-module search">
                            <div class="formTit">开始日期：</div>
                            <input id="startDate" type="text" name="startDate" style="float:left" onclick="change_picktime('yyyy-MM-dd')" readonly/>
                        </div>
                        <div class="toolbor-module search">
                            <div class="formTit">状态：</div>
                            <select id="status" name="status">
                                <option value="-1">所有
                                <option value="31">运营转理财
                                <option value="32">运营转理财[有邀请人]
                            </select>
                        </div>
                    </div>

                    <!--工具栏--}-->

                    <div id="main" class="clearfix">
                        <form id="batchForm" action="/admin/crm/batchChange.html" method="post">
                            <table class="data-list">
                                <tr class="header">
                                    <td>客户ID</td>
                                    <td>用户名</td>
                                    <td>姓名</td>
                                    <td>手机</td>
                                    <td>性别</td>
                                    <td>出生日期</td>
                                    <td>身份证号码</td>
                                    <td>客户邮箱</td>
                                    <td>通讯地址</td>
                                    <td>创建时间</td>
                                    <td>理财经理</td>
                                    <td>理财方式</td>
                                    <td>风险承受能力</td>
                                    <td>注册意向</td>
                                    <td>关系状态</td>
                                    <td>备注</td>
                                    <td>操作</td>
                                </tr>
                                <#list custList as item>
                                    <tr class="s">
                                        <td><#if item.user??>${item.user.userId!''}</#if></td>
                                        <td><#if item.user??>${item.user.userName!''}</#if></td>
                                        <td>${item.custName!''}</td>
                                        <td>${item.phone!''}</td>
                                        <td><#if item.gender==0>保密<#elseif item.gender==1>男<#else>女</#if></td>
                                        <td><#if item.birthday??>${(item.birthday)?string('yyyy-MM-dd')}<#else></#if></td>
                                        <td>${item.identityNumber!''}</td>
                                        <td>${item.email!''}</td>
                                        <td>${item.addr!''}</td>
                                        <td><#if item.createDate??>${(item.createDate)?string("yyyy-MM-dd HH:mm:ss")}</#if></td>
                                        <td><#if item.systemUser??>${item.systemUser.realname!''}</#if></td>

                                        <td>
                                            <#if item.financialType==1>线上<#else>线下</#if>

                                        </td>
                                        <td><#if item.riskCapacity==1>低<#elseif item.riskCapacity==2>中<#else>高</#if></td>
                                        <td><#if item.intention==1>低<#elseif item.intention==2>中<#else>高</#if></td>


                                        <td><font color="blue"><#if item.status==31>运营转理财<#elseif item.status==32>运营转理财[有邀请人]</#if></font></td>
                                        <td>${item.memo!''}</td>

                                        <td>

                                        </td>

                                    </tr>
                                </#list>
                            </table>
                            <input  type="hidden" id="custfmId" name ="fmId">
                            <input  type="hidden" id="regFlag" name ="regFlag" value='${regFlag}'>
                        </form>


                        <!--底部工具栏--{-->
                        <div id="bottomToolbar" class="clearfix">
                            <div class="other-tool">
                                <dl class="refresh-data">
                                    <dt class="refresh-data-icon"></dt>
                                    <dd><a href="javascript:void(0);" class="refresh-page">刷新数据</a></dd>
                                </dl>
                            </div>
                            <!--翻页系统--{-->
                            <div class="container s_formPage">
                                <#import "../../common/page.html" as pager>
                                    <@pager.pagination page=page url="${pageUrl}" map=param style="style1" />
                            </div>
                            <!--翻页系统--}-->
                        </div>
                        <!--底部工具栏--}-->


                        <script>
                            var url = 'showFromYyToCf.html?search=true';
                            function sousuo(){
                                var sou = "";
                                var ofp = $("#searchName").val();
                                var userName = $("#userName").val();

                                var startDate = $("#startDate").val();
                                var endDate = $("#endDate").val();
                                var status = $("#status").val();

                                if((ofp!=null&&ofp!=""&&ofp!="undefined"&&ofp!="请输入(姓名 /身份证/手机)关键字")){
                                    sou += "&searchName="+ofp;
                                }
                                if((userName!=null&&userName!=""&&userName!="undefined" && userName!="请输入用户名")){
                                    sou += "&userName="+userName;
                                }

                                if(startDate!=null && startDate !=""){
                                    sou+="&startDate="+startDate;
                                }
                                if(endDate!=null && endDate !=""){
                                    sou+="&endDate="+endDate;
                                }
                                if(status>=-1){
                                    sou+="&status="+status;
                                }

                                if (sou!=""){
                                    location.href=url+sou;
                                }
                            }

                            //$("#searchName")[0].defaultValue=getQueryString("searchName","请输入(姓名 /身份证/手机)关键字");
                            //$("#fmName")[0].defaultValue=getQueryString("fmName","请输入理财经理关键字");
                            function getQueryString(name,tip){
                                var reg=new  RegExp("(^|&)"+name+"=([^&]*)(&|$)");
                                var r =window.location.search.substr(1).match(reg);
                                if(r!=null)
                                    return  decodeURI(r[2]);
                                return  tip;
                            }



                            function exportxls(){
                                var num='${(page.total)?c}';
                                num=num.replace(",","");
                                if(num>30000){ //条数自己定义，但必须小于65536
                                    alert("数据过多，请选择指定的时间进行数据查询导出！"); //提示信息根据不同的内容注意修改下。
                                    return false;
                                }
                                location.href='queryCustomer.html?export=export&regFlag=${regFlag}';
                            }
                        </script>
                    </div>
        </div>
    </div>
    <div class="mc-b">
        <#include "../foot.html">
    </div>
    <#include "../jsPage.html">
        <script type="text/javascript">
            $("#chk_all").click(function(){
                $("input[name='custIds']").attr("checked",$(this).attr("checked"));
            });
            $("#batchchange").click(function(){
                var flag = false;

                $("input[name='custIds']:checked").each(function() {
                    if($(this).attr("checked")){
                        flag =true;
                        return false
                    }
                });

                if(flag){
                    $("#custfmId").val($("#fmId").val());
                    $("#batchForm").submit();
                }else{
                    alert("请选择更改理财经理的客户!");
                }

            });
        </script>
    </body>
</html>


